package com.wgf.controller;

import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MultiModelController {

    @Resource(name = "qwen")
    private ChatModel chatModelqwen;

    @Resource(name = "deepseek")
    private ChatModel chatModelDeepseek;

    //http://localhost:9002/multimodel/qwen
    @GetMapping(value = "/multimodel/qwen")
    public String qwenCall(@RequestParam(name = "prompt",defaultValue = "你是谁") String prompt){
        String result = chatModelqwen.chat(prompt);
        System.out.println("qwen通过langchain4j调用模型返回结果：\\n"+result);
        return result;
    }

    // http://localhost:9002/multimodel/deepseek
    @GetMapping(value = "/multimodel/deepseek")
    public String deepseekCall(@RequestParam(name = "prompt",defaultValue = "你是谁") String prompt){
        String result = chatModelDeepseek.chat(prompt);
        System.out.println("deepseek通过langchain4j调用模型返回结果：\\n"+result);
        return result;
    }

}
